package model

import (
	"fmt"

	"gorm.io/gorm"
)

type Users struct {
	gorm.Model
	Name     string `json:"name" gorm:"column:name;type:varhcar(36);NOT NULL"`         //用户名
	Identity string `json:"identity" gorm:"column:identity;type:varhcar(36);NOT NULL"` //用户唯一标识
	Password string `json:"password" gorm:"column:password;type:varhcar(36);NOT NULL"` //密码
	Phone    string `json:"phone" gorm:"column:phone;type:varhcar(36);NOT NULL"`       //手机
	Mail     string `json:"mail" gorm:"column:mail;type:varhcar(36);NOT NULL"`         //邮箱
}

func (Users) TableName() string {
	return "users"
}

func GetUserList() {
	data := make([]*Users, 0)
	DB.Find(*&data)
	for _, val := range data {
		fmt.Println(val)
	}
}
